feat: Introduce 'traverse' library #117
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Traversing over block data is a very common task and, at the same time, more complex that it should be. Reasons are:
The new
pallas-traverse
lib attempts to abstract away that complexity by creating a multi-era layer on top of the ledger primitives. By providing aMultiEraBlock
and aMultiEraTx
, the lib consumer can code against a single structure regardless of the era.This is an example of how to iterate over Tx of blocks from multiple eras (see `examples/block-decode):
The api surface of the lib is still limited, but the goal is to evolve it so that it becomes a single point of entry for "traversing" over any block data. At some point, this will be a replacement of the ad-hoc "crawling" mechanism that we have in Oura.